package com.xmy.cultivate.mapper;

import com.xmy.cultivate.entity.StudentAllotTierSet;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 学生分层设置 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2024-12-12
 */
public interface StudentAllotTierSetMapper extends BaseMapper<StudentAllotTierSet> {

    @Select("select * from student_allot_tier_set where year_part = ${yearPart} and quarter_num = ${quarterNum} and subjects_id = ${subjectsId} and (grade_section = ${gradeSection} or year_class_id = ${yearClassId}) limit 1")
    public StudentAllotTierSet getAllotOne(@Param("yearPart") Integer yearPart,
                                           @Param("quarterNum") Integer quarterNum,
                                           @Param("subjectsId") Long subjectsId,
                                           @Param("gradeSection") Integer gradeSection,
                                           @Param("yearClassId") Integer yearClassId
                                           );
}
